package com.schoolvisitors.vo;

import com.schoolvisitors.entity.Admin;
import com.schoolvisitors.utils.TimeUtil;
import lombok.Data;

@Data
public class AdminVo {
    private long id;
    private String username;
    private String createTime;
    private Long roleId;
    private String roleName;
    private String realName;
    private boolean reviewer;

    public AdminVo(Admin admin) {
        this.id = admin.getId();
        this.username = admin.getUsername();
        this.roleName = admin.getRole().getName();
        this.roleId = admin.getRole().getId();
        this.realName = admin.getRealName();
        this.reviewer = admin.getReviewer();
        this.createTime = admin.getCreateTime().toString();
    }
}
